package cn.edu.tju.cas.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by catold on 16/3/12.
 */
@Entity
@Table(name = "USER_GROUP_FORM_VALUE", schema = "dev_cas", catalog = "")
public class UserGroupFormValueEntity implements Serializable {
    private int userGroupFormValueId;
    private Integer userGroupApplyId;
    private Integer groupFormId;
    private String value;
    private Timestamp createtime;
    private Timestamp updatetime;


//    private GroupFormEntity groupFormEntity;

//    public GroupFormEntity getGroupFormEntity() {
//        return groupFormEntity;
//    }
//
//    public void setGroupFormEntity(GroupFormEntity groupFormEntity) {
//        this.groupFormEntity = groupFormEntity;
//    }

    @Id
    @GeneratedValue
    @Column(name = "USER_GROUP_FORM_VALUE_ID", nullable = false)
    public int getUserGroupFormValueId() {
        return userGroupFormValueId;
    }

    public void setUserGroupFormValueId(int userGroupFormValueId) {
        this.userGroupFormValueId = userGroupFormValueId;
    }

    @Basic
    @Column(name = "USER_GROUP_APPLY_ID", nullable = true)
    public Integer getUserGroupApplyId() {
        return userGroupApplyId;
    }

    public void setUserGroupApplyId(Integer userGroupApplyId) {
        this.userGroupApplyId = userGroupApplyId;
    }

    @Basic
    @Column(name = "GROUP_FORM_ID", nullable = true)
    public Integer getGroupFormId() {
        return groupFormId;
    }

    public void setGroupFormId(Integer groupFormId) {
        this.groupFormId = groupFormId;
    }

    @Basic
    @Column(name = "VALUE", nullable = true, length = 255)
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Basic
    @Column(name = "CREATETIME", nullable = true)
    public Timestamp getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
    }

    @Basic
    @Column(name = "UPDATETIME", nullable = true)
    public Timestamp getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Timestamp updatetime) {
        this.updatetime = updatetime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserGroupFormValueEntity that = (UserGroupFormValueEntity) o;

        if (userGroupFormValueId != that.userGroupFormValueId) return false;
        if (userGroupApplyId != null ? !userGroupApplyId.equals(that.userGroupApplyId) : that.userGroupApplyId != null)
            return false;
        if (groupFormId != null ? !groupFormId.equals(that.groupFormId) : that.groupFormId != null) return false;
        if (value != null ? !value.equals(that.value) : that.value != null) return false;
        if (createtime != null ? !createtime.equals(that.createtime) : that.createtime != null) return false;
        if (updatetime != null ? !updatetime.equals(that.updatetime) : that.updatetime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = userGroupFormValueId;
        result = 31 * result + (userGroupApplyId != null ? userGroupApplyId.hashCode() : 0);
        result = 31 * result + (groupFormId != null ? groupFormId.hashCode() : 0);
        result = 31 * result + (value != null ? value.hashCode() : 0);
        result = 31 * result + (createtime != null ? createtime.hashCode() : 0);
        result = 31 * result + (updatetime != null ? updatetime.hashCode() : 0);
        return result;
    }
}
